package com.cloud.pages;

import org.openqa.selenium.By;
import static org.openqa.selenium.support.ui.ExpectedConditions.presenceOfElementLocated;

public class TermsPage extends AnyPage {


    //Constructor
    public TermsPage(PageManager pages) {
        super(pages);
    }


    //Variables
    private String termsPageTitle = "Terms | Swivl";


    //Methods
    public TermsPage ensurePageLoaded() {
        wait.until(presenceOfElementLocated(By.xpath("//*/h2[text()='Terms and Conditions of Use for Swivl Cloud Service']")));
        return this;
    }

    public boolean isLoaded() {
        try {
            wait.until(presenceOfElementLocated(By.xpath("//*/h2[text()='Terms and Conditions of Use for Swivl Cloud Service']")));
            return true;
        } catch (Exception e) {
            return false;
        }
    }

    public String getTermsPageTitle() {
        return termsPageTitle;
    }

}
